<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="<?php echo base_url();?>js/knockout-1.2.1.js"></script> 
 

<script src="<?php echo base_url();?>js/jquery-1.7.1.min.js"></script>
<script src="<?php echo base_url();?>js/kendo.dataviz.min.js"></script>
<script src="<?php echo base_url();?>js/kendo.all.min.js"></script>

<link href="<?php echo base_url();?>css/kendo.common.min.css" rel="stylesheet" />
<link href="<?php echo base_url();?>css/kendo.default.min.css" rel="stylesheet" />
<!-- <link href="<?php echo base_url();?>css/t-tech.css" rel="stylesheet" /> -->
<link href="<?php echo base_url();?>css/t-tech-style.css" rel="stylesheet" />

<title>Untitled Document</title>
</head>

<body>
<?php echo form_open_multipart("comment/Addcomment");?>
<table width="450" id="grid">
        <thead>
          <tr>
            <th data-field="user_id"><div align="center">User</div></th> 
            <th data-field="comment"><div align="center">Comment</div></th>
          </tr>
        </thead>
        <tbody>
        <?php foreach ($rs as $r) 
		{
          echo "<tr>";
          echo "<td>"."<div align='center'>"."<img src='http://aboutbittorrent.org/theme/Image/user_comment.png' width='50' height='41' />"."</br>".$this->user_model->getFullName($r['user_id'])."</div>"."</td>";
          echo "<td>";
		  echo $r['comment']."</br>";
		  echo "<a href='http://".$_SERVER['SERVER_NAME'];
		  echo "/project2012-3/images/approve/".$r['file']."'>";
		  echo $r['file']."</a>"."</br>";
		  echo "โพสเมื่อ&nbsp;:&nbsp;".$r['date'];
		  echo "</td>";
		  echo  "</td>";
          echo  "</tr>";
		}
          ?>
        </tbody>
      </table>
    <script>
                $(document).ready(function() {
				 $("#grid").kendoGrid({
						columns: [
						{ field: "user_id", width: "120px" },
						{ field: "comment", width: "0" }
						],
						 
			            //height: 500,
						//filterable: true,  
                        //scrollable: false,
						//pageable: true,
						dataSource: {
							//pageSize: 10
						} 
                    });
                });
            </script>

<table width="450">
  <tr>
    <td height="40" align="right">ผู้ใช้งาน : </td>
    <td height="40"><?=$this->session->userdata('fullname')?>
    <input type="hidden" name="user_id" id="user_id" value="<?=$this->session->userdata('user_id')?>"/>
    </td>
  </tr>
  <tr>
    <td height="40" align="right" valign="top">รายละเอียด :    </td>
    <td height="40" valign="top"><textarea name="comment" id="comment" cols="45" rows="5"></textarea></td>
  </tr>
  <tr>
    <td height="40" align="right">ไฟล์ :    </td>
    <td height="40"><input type="file" name="picture" id="picture" /></td>
  </tr>
  <tr>
    <td height="40" colspan="2"  valign="top" align="center">
    <input type="Submit" name="Submit" id="Submit" value="บันทึกข้อมูล" class="k-button"/>
    <input name="date" type="hidden" id="hiddenField" value="<?php echo date("Y-m-d H:i:s");?>" />
    <input name="t_id" type="hidden" id="t_id" value="<?php echo $this->uri->segment(3);?>" /></td>
  </tr>
</table>
<?php echo form_close();?><br />
</body>
</html>